<template>
  <div>
    <Header></Header> <!-- 子页面公共头部 -->
    <div class="ej_box">
      <div class="ej_center">
        <Crumbs :lmtitle="lmtitle"></Crumbs> <!-- 面包屑导航 -->
        <div class="clear"></div>
        <div class="row">

          <div class="col-md-3">
            <SeniorSearch @search="search"></SeniorSearch>
          </div>
          <div class="col-md-9">
            <div class="ej_content_box">
					<div class="ej_content">
						<div class="ej_content_nav">
							<div class="ej_content_nav_pc">
								<h2 class="ej_content_nav_pc_h2dt">
                  <!-- class="activexz" -->
									<li v-for="item in dhData"  @click="link(item.id)" :class="formdata.columnId == item.id?'activexz':''" >{{item.name}}</li>
								</h2>
								
								<div class="clearfix"></div>
							</div>
						</div>
						
						<div class="ej_content_editor">
							
                            <ul class="date">
                            <div class="date_li" v-for="(item,index) in zhibanlist">
                                <div class="date_li_top">
                                <p> {{getweek(item.day)}}</p> 
                                </div>
                                <div class="date_li_bottom">
                                    <p v-for="list in item.data" v-if="list.name">{{list.key}}：{{list.name}}</p>
                                </div>   
                            </div>
                        

                        </ul>
							
				
						</div>
					</div>
				</div>
          </div>

          <div class="clearfix"></div>
        </div>


      </div>
    </div>
    <Foot></Foot> <!-- 网站公共底部 -->
  </div>
</template>
<script>
import Foot from "@/components/foot.vue";
import Crumbs from "@/components/crumbs.vue";
import SeniorSearch from "@/components/seniorsearch.vue";
import Cookies from 'js-cookie'
import { contentApiqueryOne } from "@/api/webviews";
import { queryCascadePage  } from "@/api/webpage";
import { queryFiveDuty  } from "@/api/webviews";
import Header from "@/components/header.vue";
export default {
  name: "articlecontent",
  components: {
    Header,
    Crumbs,
    SeniorSearch,
    Foot
  },
  data() {
    return {
      dhData:[],
      ParentId:'',
      formdata:{},
      fontsize:'14',
      lmtitle:'今日值班',
      ishow:true,
      zhibanlist:[]
    };
  },
  created() {
    this.dhData = JSON.parse(Cookies.get('navdata'))[this.$route.query.navId]
    // this.getdata(this.$route.query.id)
    if(this.$route.query.id == 'C0A8B1507E0441F28FA9448DF52AC6DC'||this.$route.query.id == '2293BE31C5B4449FA5487BA2228BA6ED'){
      this.ishow = false
    }
    this.get()
    // this.getyqlj()
  },
  watch: {
	    //监听路由地址的改变
	    $route:{
	        immediate:true,
	        handler(){
	            if(this.$route.query.id){//需要监听的参数
                this.getdata(this.$route.query.id)
                this.lmtitle = JSON.parse(Cookies.get('navdata'))[this.$route.query.navId][0].name
                this.dhData = JSON.parse(Cookies.get('navdata'))[this.$route.query.navId]
	            }
	        }
	    }
	},
  methods: {
    getweek(date){
      let myDate = new Date(date)
      let wk = myDate.getDay()
      let arra = date.split("-")
      let font = wk==1?'星期一':wk==2?'星期二':wk==3?'星期三':wk==4?'星期四':wk==5?'星期五':wk==6?'星期六':'星期日'
      return  arra[1]+'月'+arra[2]+'日 '+ font
    },
    get(){
      queryFiveDuty().then(res=>{
        if(res.code == 0){
          this.zhibanlist = res.data
        }
      })
    },
  },
};
</script>
<style>
  @import "../assets/css/font/iconfont.css";
  @import "../assets/css/index.css";
  @import "../assets/css/style.css";
  </style>